﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Platformer
{
    abstract public class Weapon
    {
        protected PlatformerGame game;
        protected Texture2D texture;
        protected Vector2 position;

        public int FireRate
        {
            get { return fireRate; }
        }
        protected int fireRate;

        public int Damage
        {
            get { return damage; }
        }
        protected int damage;

        /// <summary>
        /// Level of the weapon, between 1 and 3
        /// </summary>
        public int Level
        {
            get { return level; }
            set { level = value; }
        }
        protected int level = 1;

        public Weapon(PlatformerGame game)
        {
            this.game = game;
        }

        // Might be useless
        public virtual void Update()
        {

        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }

        /* Custom */
        public virtual void Fire()
        {
            CreateBullet();
        }

        protected abstract void CreateBullet();

    }
}
